package cn.smartopen.aispace.status;

import io.swagger.v3.oas.annotations.media.Schema;

public class ResponseResult<T> {  
  
    @Schema(title = "状态码")
    private int code;  
    @Schema(title = "状态描述信息")
    private String message;  
    @Schema(title = "数据")
    private T data;  
  
    // 构造函数，使用ResponseCode来初始化code和message  
    public ResponseResult(ResponseCode responseCode) {  
        this.code = responseCode.getCode();  
        this.message = responseCode.getMessage();  
    }  
  
    // 构造函数，允许自定义data  
    public ResponseResult(ResponseCode responseCode, T data) {  
        this(responseCode);  
        this.data = data;  
    }  
  
    // Getter和Setter方法  
    public int getCode() {  
        return code;  
    }  
  
    public void setCode(int code) {  
        this.code = code;  
    }  
  
    public String getMessage() {  
        return message;  
    }  
  
    public void setMessage(String message) {  
        this.message = message;  
    }  
  
    public T getData() {  
        return data;  
    }  
  
    public void setData(T data) {  
        this.data = data;  
    }  
}